-
Notifications
You must be signed in to change notification settings - Fork 600
[llm] Fix start_pos not being updated in prefill_chunk() #11592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11592
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 63b860c with merge base a6d8440 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: This PR fixes `TextPrefiller` class `prefill_chunk` API. We should update `start_pos` at the end of the while loop. ### Enhancements to `TextPrefiller` functionality: * Renamed `prefillChunk` to `prefill_chunk` for consistency across method names in `TextPrefiller` class. Updates were made in both `text_prefiller.cpp` and `text_prefiller.h`. [[1]](diffhunk://#diff-a990c73be85dcbe7ef7e2ca02082fc0beb9951c1a8973587575a3e285f134cedL59-R74) [[2]](diffhunk://#diff-d8c18164204bbba3d0e0ccdf0c6e7f776f8865d66ec3b4129fcba641dcd7aed4L48-R48) * Adjusted the `start_pos` increment logic in the `prefill` method to ensure accurate position updates after processing each chunk. ### Comprehensive unit tests for `TextPrefiller`: * Added a new test file `test_text_prefiller.cpp` with detailed test cases for `TextPrefiller`, including edge cases, error handling, and scenarios for parallel and sequential prefill modes. Mock classes and spy implementations were introduced to facilitate testing. Differential Revision: D76483572 Pulled By: larryliu0820
dc9cbba
to
65086d1
Compare
This pull request was exported from Phabricator. Differential Revision: D76483572 |
Summary: This PR fixes `TextPrefiller` class `prefill_chunk` API. We should update `start_pos` at the end of the while loop. ### Enhancements to `TextPrefiller` functionality: * Renamed `prefillChunk` to `prefill_chunk` for consistency across method names in `TextPrefiller` class. Updates were made in both `text_prefiller.cpp` and `text_prefiller.h`. [[1]](diffhunk://#diff-a990c73be85dcbe7ef7e2ca02082fc0beb9951c1a8973587575a3e285f134cedL59-R74) [[2]](diffhunk://#diff-d8c18164204bbba3d0e0ccdf0c6e7f776f8865d66ec3b4129fcba641dcd7aed4L48-R48) * Adjusted the `start_pos` increment logic in the `prefill` method to ensure accurate position updates after processing each chunk. ### Comprehensive unit tests for `TextPrefiller`: * Added a new test file `test_text_prefiller.cpp` with detailed test cases for `TextPrefiller`, including edge cases, error handling, and scenarios for parallel and sequential prefill modes. Mock classes and spy implementations were introduced to facilitate testing. Differential Revision: D76483572 Pulled By: larryliu0820
65086d1
to
362f17d
Compare
This pull request was exported from Phabricator. Differential Revision: D76483572 |
@larryliu0820 has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary: This PR fixes `TextPrefiller` class `prefill_chunk` API. We should update `start_pos` at the end of the while loop. ### Enhancements to `TextPrefiller` functionality: * Renamed `prefillChunk` to `prefill_chunk` for consistency across method names in `TextPrefiller` class. Updates were made in both `text_prefiller.cpp` and `text_prefiller.h`. [[1]](diffhunk://#diff-a990c73be85dcbe7ef7e2ca02082fc0beb9951c1a8973587575a3e285f134cedL59-R74) [[2]](diffhunk://#diff-d8c18164204bbba3d0e0ccdf0c6e7f776f8865d66ec3b4129fcba641dcd7aed4L48-R48) * Adjusted the `start_pos` increment logic in the `prefill` method to ensure accurate position updates after processing each chunk. ### Comprehensive unit tests for `TextPrefiller`: * Added a new test file `test_text_prefiller.cpp` with detailed test cases for `TextPrefiller`, including edge cases, error handling, and scenarios for parallel and sequential prefill modes. Mock classes and spy implementations were introduced to facilitate testing. Reviewed By: mergennachin Differential Revision: D76483572 Pulled By: larryliu0820
602b50a
to
63b860c
Compare
This pull request was exported from Phabricator. Differential Revision: D76483572 |
This PR fixes
TextPrefiller
classprefill_chunk
API. We should updatestart_pos
at the end of the while loop.Enhancements to
TextPrefiller
functionality:prefillChunk
toprefill_chunk
for consistency across method names inTextPrefiller
class. Updates were made in bothtext_prefiller.cpp
andtext_prefiller.h
. [1] [2]start_pos
increment logic in theprefill
method to ensure accurate position updates after processing each chunk.Comprehensive unit tests for
TextPrefiller
:test_text_prefiller.cpp
with detailed test cases forTextPrefiller
, including edge cases, error handling, and scenarios for parallel and sequential prefill modes. Mock classes and spy implementations were introduced to facilitate testing.